/*
 * @Author: Joker
 * @Date: 2017-11-28 12:19:27
 * @Last Modified by: Joker
 * @Last Modified time: 2017-12-28 17:44:13
 */
import Vue from 'vue'
import Router from 'vue-router'

const Login = r => require.ensure([], () => r(require('../views/login/login.vue'))); 
const Index = r => require.ensure([], () => r(require('../views/index/index.vue')));
const HomePage = r => require.ensure([], () => r(require('../views/homePage/homePage.vue')));
const YSSystem = r => require.ensure([], () => r(require('../views/digitalMonitoring/ysSystem/ysSystem.vue')));
const ZDHHJMonitorSystem = r => require.ensure([], () => r(require('../views/digitalMonitoring/zdhhjMonitorSystem/zdhhjMonitorSystem.vue')));
const ZGMonitorSystem = r => require.ensure([], () => r(require('../views/digitalMonitoring/zgMonitorSystem/zgMonitorSystem.vue')));
const Construction = r => require.ensure([], () => r(require('../views/construction/construction.vue')));
const AssetManagement = r => require.ensure([], () => r(require('../views/assetManagement/assetManagement.vue')));
const DeviceManagement = r => require.ensure([], () => r(require('../views/assetManagement/deviceManagement/deviceManagement.vue')));
const VehicleManagement = r => require.ensure([], () => r(require('../views/assetManagement/vehicleManagement/vehicleManagement.vue')));
const MessageManagement = r => require.ensure([], () => r(require('../views/messageManagement/messageManagement.vue')));
const SystemManagement = r => require.ensure([], () => r(require('../views/systemManagement/systemManagement.vue')));
const DepartmentManagement = r => require.ensure([], () => r(require('../views/systemManagement/departmentManagement/departmentManagement.vue')));
const UserManagement = r => require.ensure([], () => r(require('../views/systemManagement/userManagement/userManagement.vue')));
const UserGroupManagement = r => require.ensure([], () => r(require('../views/systemManagement/userGroupManagement/userGroupManagement.vue')));
const RoleManagement = r => require.ensure([], () => r(require('../views/systemManagement/roleManagement/roleManagement.vue')));
const ProjectManagement = r => require.ensure([], () => r(require('../views/systemManagement/projectManagement/projectManagement.vue')));
Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      name: 'login',
      component: Login
    },
    {
        path: '/login',
        name: 'login',
        component: Login
      },
    {
      path: '/index',
      name: 'index',
      component: Index,
      children: [
        //首页
        {
          path: 'homePage',
          component: HomePage
        },
        //数字化监控   压实系统
        {
          path: 'digitalMonitoring/ysSystem',
          component: YSSystem
        },
        //数字化监控   自动化夯机监控系统
        {
          path: 'digitalMonitoring/zdhhjMonitorSystem',
          component: ZDHHJMonitorSystem
        },
        //数字化监控   振搞监控系统
        {
          path: 'digitalMonitoring/zgMonitorSystem',
          component: ZGMonitorSystem
        },
        //不停航施工
        {
          path: 'construction/:id',
          component: Construction
        },
        //资产管理
        {
          path: 'assetManagement',
          component: AssetManagement,
          children: [
            //资产管理   车辆管理
            {
              path: 'vehicleManagement',
              component: VehicleManagement
            },
            //资产管理   设备管理
            {
              path: 'deviceManagement',
              component: DeviceManagement
            },
          ]
        },
        //消息管理
        {
          path: 'messageManagement',
          component: MessageManagement
        },
        //系统管理
        {
          path: 'systemManagement',
          component: SystemManagement,
          children: [
            //系统管理   部门管理
            {
              path: 'departmentManagement',
              component: DepartmentManagement
            },
            //系统管理   用户管理
            {
              path: 'userManagement',
              component: UserManagement
            },
            //系统管理   用户组管理
            {
              path: 'userGroupManagement',
              component: UserGroupManagement
            },
            //系统管理   角色管理
            {
              path: 'roleManagement',
              component: RoleManagement
            },
            //系统管理   项目管理
            {
              path: 'projectManagement',
              component: ProjectManagement
            },

          ]
        },

      ]
    }
  ]
})
